.class public Lcom/xingbook/park/d/f;
.super Ljava/lang/Object;


# static fields
.field private static a:Ljava/util/ArrayList;

.field private static b:Z


# direct methods
.method static constructor <clinit>()V
    .locals 1

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    sput-object v0, Lcom/xingbook/park/d/f;->a:Ljava/util/ArrayList;

    const/4 v0, 0x0

    sput-boolean v0, Lcom/xingbook/park/d/f;->b:Z

    return-void
.end method

.method public static a(I)Lcom/xingbook/park/b/a;
    .locals 4

    const/4 v1, 0x0

    const/4 v0, 0x1

    invoke-static {v0}, Lcom/xingbook/park/d/f;->b(Z)V

    sget-object v0, Lcom/xingbook/park/d/f;->a:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_3

    move-object v0, v1

    :goto_0
    if-eqz v0, :cond_2

    invoke-virtual {v0}, Lcom/xingbook/park/b/a;->b()Z

    move-result v2

    if-eqz v2, :cond_2

    sget-object v0, Lcom/xingbook/park/d/f;->a:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_1
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_4

    move-object v0, v1

    :cond_2
    :goto_1
    return-object v0

    :cond_3
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/park/b/a;

    invoke-virtual {v0}, Lcom/xingbook/park/b/a;->a()I

    move-result v3

    if-ne v3, p0, :cond_0

    goto :goto_0

    :cond_4
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/park/b/a;

    invoke-virtual {v0}, Lcom/xingbook/park/b/a;->a()I

    move-result v3

    if-nez v3, :cond_1

    goto :goto_1
.end method

.method private static a(ZZ)V
    .locals 2

    if-eqz p1, :cond_0

    invoke-static {p0}, Lcom/xingbook/park/d/f;->a(Z)Z

    :goto_0
    return-void

    :cond_0
    sget-object v0, Lcom/xingbook/c/o;->h:Ljava/util/concurrent/ExecutorService;

    new-instance v1, Lcom/xingbook/park/d/h;

    invoke-direct {v1, p0}, Lcom/xingbook/park/d/h;-><init>(Z)V

    invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V

    goto :goto_0
.end method

.method public static declared-synchronized a()Z
    .locals 2

    const-class v0, Lcom/xingbook/park/d/f;

    monitor-enter v0

    :try_start_0
    sget-boolean v1, Lcom/xingbook/park/d/f;->b:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit v0

    return v1

    :catchall_0
    move-exception v1

    monitor-exit v0

    throw v1
.end method

.method public static declared-synchronized a(Z)Z
    .locals 8

    const/4 v0, 0x0

    const-class v2, Lcom/xingbook/park/d/f;

    monitor-enter v2

    :try_start_0
    sget-boolean v1, Lcom/xingbook/park/d/f;->b:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-eqz v1, :cond_0

    if-nez p0, :cond_0

    :goto_0
    monitor-exit v2

    return v0

    :cond_0
    const/4 v1, 0x1

    :try_start_1
    new-instance v3, Ljava/io/File;

    sget-object v4, Lcom/xingbook/c/c;->C:Ljava/lang/String;

    invoke-direct {v3, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    if-nez p0, :cond_1

    invoke-virtual {v3}, Ljava/io/File;->exists()Z

    move-result v4

    if-eqz v4, :cond_1

    invoke-virtual {v3}, Ljava/io/File;->length()J
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-result-wide v4

    const-wide/16 v6, 0x0

    cmp-long v4, v4, v6

    if-nez v4, :cond_2

    :cond_1
    :try_start_2
    new-instance v4, Ljava/net/URL;

    const-string v5, "http://app2.xingbook.com/shaixuan.xml"

    invoke-direct {v4, v5}, Ljava/net/URL;-><init>(Ljava/lang/String;)V

    invoke-virtual {v4}, Ljava/net/URL;->openStream()Ljava/io/InputStream;

    move-result-object v4

    invoke-static {v3, v4}, Lcom/xingbook/c/h;->a(Ljava/io/File;Ljava/io/InputStream;)Z
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0

    :cond_2
    :goto_1
    :try_start_3
    invoke-static {}, Lcom/xingbook/park/d/f;->b()V

    invoke-static {}, Ljavax/xml/parsers/SAXParserFactory;->newInstance()Ljavax/xml/parsers/SAXParserFactory;
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    move-result-object v4

    :try_start_4
    invoke-virtual {v4}, Ljavax/xml/parsers/SAXParserFactory;->newSAXParser()Ljavax/xml/parsers/SAXParser;

    move-result-object v4

    new-instance v5, Ljava/io/FileInputStream;

    invoke-direct {v5, v3}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V

    new-instance v6, Lcom/xingbook/park/d/g;

    invoke-direct {v6}, Lcom/xingbook/park/d/g;-><init>()V

    invoke-virtual {v4, v5, v6}, Ljavax/xml/parsers/SAXParser;->parse(Ljava/io/InputStream;Lorg/xml/sax/helpers/DefaultHandler;)V
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0
    .catch Ljava/io/FileNotFoundException; {:try_start_4 .. :try_end_4} :catch_1
    .catch Ljavax/xml/parsers/ParserConfigurationException; {:try_start_4 .. :try_end_4} :catch_2
    .catch Lorg/xml/sax/SAXException; {:try_start_4 .. :try_end_4} :catch_3
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_4

    move v0, v1

    :goto_2
    :try_start_5
    invoke-static {v0}, Lcom/xingbook/park/d/f;->c(Z)V
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit v2

    throw v0

    :catch_0
    move-exception v1

    :try_start_6
    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

    move v1, v0

    goto :goto_1

    :catch_1
    move-exception v1

    invoke-virtual {v1}, Ljava/io/FileNotFoundException;->printStackTrace()V

    goto :goto_2

    :catch_2
    move-exception v1

    invoke-virtual {v1}, Ljavax/xml/parsers/ParserConfigurationException;->printStackTrace()V

    invoke-virtual {v3}, Ljava/io/File;->delete()Z

    goto :goto_2

    :catch_3
    move-exception v1

    invoke-virtual {v1}, Lorg/xml/sax/SAXException;->printStackTrace()V

    invoke-virtual {v3}, Ljava/io/File;->delete()Z

    goto :goto_2

    :catch_4
    move-exception v1

    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V
    :try_end_6
    .catchall {:try_start_6 .. :try_end_6} :catchall_0

    goto :goto_2
.end method

.method public static b()V
    .locals 1

    sget-object v0, Lcom/xingbook/park/d/f;->a:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    const/4 v0, 0x0

    invoke-static {v0}, Lcom/xingbook/park/d/f;->c(Z)V

    return-void
.end method

.method public static b(Z)V
    .locals 4

    const/4 v2, 0x0

    const/4 v0, 0x1

    :try_start_0
    invoke-static {}, Lcom/xingbook/park/d/f;->a()Z

    move-result v1

    if-eqz v1, :cond_1

    move v1, v2

    :goto_0
    sget-object v3, Lcom/xingbook/park/d/f;->a:Ljava/util/ArrayList;

    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I
    :try_end_0
    .catch Ljava/lang/NullPointerException; {:try_start_0 .. :try_end_0} :catch_0

    move-result v3

    if-nez v3, :cond_2

    :goto_1
    if-eqz v0, :cond_0

    invoke-static {v2, p0}, Lcom/xingbook/park/d/f;->a(ZZ)V

    :cond_0
    return-void

    :cond_1
    move v1, v0

    goto :goto_0

    :catch_0
    move-exception v1

    goto :goto_1

    :cond_2
    move v0, v1

    goto :goto_1
.end method

.method static synthetic c()Ljava/util/ArrayList;
    .locals 1

    sget-object v0, Lcom/xingbook/park/d/f;->a:Ljava/util/ArrayList;

    return-object v0
.end method

.method private static declared-synchronized c(Z)V
    .locals 2

    const-class v0, Lcom/xingbook/park/d/f;

    monitor-enter v0

    :try_start_0
    sput-boolean p0, Lcom/xingbook/park/d/f;->b:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit v0

    return-void

    :catchall_0
    move-exception v1

    monitor-exit v0

    throw v1
.end method
